var e = require("../../../../@babel/runtime/helpers/regeneratorRuntime"),
  n = require("../../../../@babel/runtime/helpers/slicedToArray"),
  t = require("../../../../@babel/runtime/helpers/asyncToGenerator"),
  o = require("../../../../utils/helper/common/index"),
  r = require("./utils");
Page({
  useStore: function (e) {
    return {
      userInfo: e.user.userInfo,
      customerServicePhone: e.global.customerServicePhone
    }
  },
  data: {
    inviteModalVisible: !1,
    showRechargePopup: !1,
    panelConfig:[],
    // panelConfig: [{
    //   "title": {
    //     "text": "",
    //     "color": "#262626"
    //   },
    //   "children": [{
    //     "title": {
    //       "text": "我的银行卡",
    //       "color": "#262626"
    //     },
    //     "remark": {
    //       "text": "",
    //       "color": "#8C8C8C"
    //     },
    //     "btn": {
    //       "text": "",
    //       "btnColor": "#FF9802",
    //       "fontColor": "#FF9802"
    //     },
    //     "route": {
    //       "Android": "TYPE_INVITE",
    //       "ios": "yupaojixie://to_invite",
    //       "xcx": "TYPE_INVITE"
    //     },
    //     "icon": "https://mp-78644cf8-2fa7-4805-8999-9c23996903e0.cdn.bspapp.com/银行卡.png",
    //   }]
    // }],
    isIos: $.isIos,
    balance: 0
  },
  onShow: function () {
    this.getBalance()
  },
  openRechargePopup: function () {
    this.setData({
      showRechargePopup: !0
    })
  },
  onCloseRechargePopup: function () {
    this.setData({
      showRechargePopup: !1
    })
  },
  onClickToRecord: function () {
    $.router.push("/subpackage/personal/integral/list/index")
  },
  withdraw() {
    wx.navigateTo({
      url: '/subpackage/personal/withdraw/index',
    })
  },
  handleCallPhone: function () {
    (0, o.callPhone)(this.data.customerServicePhone)
  },
  getBalance() {
    wx.showLoading({
      title: '加载中...',
    })
    $.request['GET/business/wechat/account/detail']().then(res => {
      res = res[0]
      if (res.code === 20002) {
        this.setData({
          balance: res.data.balance
        })
      } else {
        $.msg(res.msg)
      }
    }).finally(() => {
      wx.hideLoading()
    })
  },
  goToPage: function (e) {
    wx.navigateTo({
      url: '/subpackage/personal/integral/bank/index',
    })
  },
  onCloseInviteModal: function () {
    this.setData({
      inviteModalVisible: !1
    })
  }
});